package com.sunop.userservice.controller;


import com.sunop.userservice.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * @since 2025-03-13
 */
@RestController
@RequestMapping("/role")
public class RoleController {
    private final RoleService roleService;

    public RoleController(RoleService roleService) {
        this.roleService = roleService;
    }

    @PostMapping("/fegin/updateUserPoints")
    public Void updateUserPoints(Integer userId, Integer points) {
        roleService.updateUserPoints(userId, points);
        return null;
    }

    @PostMapping("/fegin/updateProblemPoint")
    public Void updateProblemPoint(int userId, int points) {
        roleService.updateProblemPoint(userId, points);
        return null;
    }
}
